<script setup>
import { computed,ref } from 'vue'
// 声明数据
const list = ref([1, 2, 3, 4, 5, 6, 7, 8])
// 基于list派生出一个计算属性，过滤出>2
const filterList = computed(() => {
  return list.value.filter(item => item > 2)
})

const addFn = () =>{
    list.value.push(11)
}

</script>

<template>
<div>
    <div>{{ list }}</div>
    <div>{{ filterList }}</div>
    <button @click="addFn">+</button>
</div>
</template>